<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="vueInside">
        <input type="text" v-myorder='mycolor'>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    // 自定义指令
    // vue实例
    var vueli = new Vue({
        el: '#vueInside',
        data() {
            return {
                mycolor: 'yellow',
            }
        },
        methods: {},
        directives: {
            'myorder': {
                bind: function(el, bind) {
                    el.style.backgroundColor = bind.value;
                }
            }
        }
    })
</script>

</html>